/**
 * 根组建
 */
import React from 'react'
import { Outlet } from 'react-router-dom'
import Loading from '@/components/Loading'
import { useSelector } from 'react-redux';
import { ICommonState } from '@/types/storeTypes/storyTypes';

const Layout: React.FC = (props: any) => {
    const loading = useSelector<ICommonState, boolean>(state => state.common.loading);
    return <div id='app'>
        {/* loading 状态 */}
        {
            loading ? <Loading /> : ''
        }

        {/* 路由插槽 */}
        <Outlet />
    </div>
}


export default Layout;